<?php
class FashionController extends Controller
{
	public $layout = '//layouts/main';
	
	public function actionCategory()
	{
		if(isset($_GET['id'])) {
			$type = Type::model()->findByPk($_GET['id']);
			if($type) {
				$this->render('category',array('categories'=>$type->categories,'type'=>$type));
			}
		}
		else
			throw new CHttpException(404);
	}
	
	public function actionProducts()
	{
		if(isset($_GET['id'])) {
			$category = Category::model()->findByPk($_GET['id']);
			if($category) {
				$this->render('products',array('products'=>$category->products));
			}
		}
		else
			throw new CHttpException(404);		
	}
	
	public function actionView()
	{
		
	}
}